﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace AtlasGis
{
    public class Order
    {
        public string tenbando { get; set; }
        public string hinh { get; set; }
        public int stt { get; set; }

    }
    
    public partial class ucXemSach : UserControl
    {
        private string[] strBDPath;
        private string[] strBDName;
        private int slTrang;
        private int count;
        public ucXemSach()
        {
            InitializeComponent();
            count = 0;
            strBDPath = new string[3] { @"D:\nienluan\Desktop\img001.jpg", @"D:\nienluan\Desktop\img002.jpg", @"C:\Users\X550LD\Desktop\AtlasGIS-Temp\bookcontrol\map\images\nongnghiep_vn.JPG" };
            strBDName = new string[3] { @"Bản đồ hành chính", @"Bản đồ khí hậu", @"Bản đồ nông nghiệp" };

            List<Order> orderList = new List<Order>();

            for (int i = 0; i < 3; i++)
            {
                orderList.Add(new Order()
                {
                    stt = i + 1,
                    hinh = string.Copy(strBDPath[i]),
                    tenbando = string.Copy(strBDName[i])
                });
            }

            book.DataSource = orderList;
           

           
        }

        private void btnXemCT_Click(object sender, RoutedEventArgs e)
        {
            count++;

            int vt = book.PageIndex;
            
            if (vt < 0) vt++;

            if ((count%2 == 0) && (vt > 0))
                System.Diagnostics.Process.Start(strBDPath[vt+1]);
            else
                System.Diagnostics.Process.Start(strBDPath[vt]);
        }

        
    }
}
